<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<input type="hidden" id="taskIds" th:value="*{taskIds}"/>
<input type="hidden" id="poleIds" th:value="*{poleIds}"/>
<input type="hidden" id="byqIds" th:value="*{byqIds}"/>
<input type="hidden" id="Ids" th:value="*{Ids}"/>

<input id="id" name="id" type="hidden">
<input id="task_id" name="taskId" type="hidden">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('assets:pPoint:edit')}]];
        var removeFlag = [[${@permission.hasPermi('assets:pPoint:remove')}]];
        var prefix = ctx + "assets/pPoint";

        var Ids = $("#Ids").val();			//	点位ID
        var poleIds = $("#poleIds").val();	//	同杆架设组ID
        var taskIds = $("#taskIds").val();	//	任务ID
        var byqIds = $("#byqIds").val();	//	变压器ID

		var line = null
        $.post(ctx + "assets/iLine/getLineName?byqId="+byqIds, function (r) {
            line = r.iLines;
        });

        $(function() {



            var options = {
                url: prefix + "/listIsPole?poleId="+poleIds+"&taskId="+taskIds+"&id="+Ids+"&byqId="+byqIds,
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove2Id",
				exportUrl: prefix + "/export",
                showSearch:false,		//是否显示检索信息
                showRefresh:false,		//是否显示刷新按钮
                showToggle:false,		//是否显示详细视图和列表视图的切换按钮
                showColumns:false,		//是否显示隐藏某列下拉框
                sortable:false,		//是否启用排序
                modalName: "点位采集基础",
                uniqueId:'taskId',
//		        showExport: true,
                columns: [{
		            radio: true
		        },
				{
					field : 'id', 
					title : '主键',
					visible: false
				},
				{
					field : 'byqId', 
					title : '所属变压器ID',
					sortable: true,
                    visible: false
				},
                {
					field : 'code',
					title : '点位编号',
					sortable: true
				},
				{
					field : 'type', 
					title : '点位类型',
					sortable: true
				},
				{
					field : 'lineId',
					title : '所属线路',
					sortable: true,
                    formatter: function (value, row, index) {
                        /*for (index in value) {
                            if (line[index].id == value)
                                return line[index].name;
                        }*/
                        return row.lineName;
                    }
				},
				{
					field : 'voltage', 
					title : '电压等级',
					sortable: true,
                    visible: false
				},
				{
					field : 'upId', 
					title : '上联点位ID',
					sortable: true,
                    visible: false
				},
				{
					field : 'lowerId', 
					title : '下联点位ID',
					sortable: true,
                    visible: false
				},
				{
					field : 'span', 
					title : '定位档距',
					sortable: true,
                    visible: false
				},
				{
					field : 'lgt', 
					title : '定位经度',
					sortable: true,
                    visible: false
				},
				{
					field : 'lat', 
					title : '定位纬度',
					sortable: true,
                    visible: false
				},
				{
					field : 'pullNum', 
					title : '拉线数',
					sortable: true,
                    visible: false
				},
				{
					field : 'wireSplit', 
					title : '是否导线分段 数据字典split_type (是，否)',
					sortable: true,
                    visible: false
				},
				{
					field : 'materId', 
					title : '导线型号ID',
					sortable: true,
                    visible: false
				},
				{
					field : 'inletLine', 
					title : '进户线长度',
					sortable: true,
                    visible: false
				},
				{
					field : 'isPole', 
					title : '是否同杆架设 数据字典',
					sortable: true,
                    visible: false
				},
				{
					field : 'poleId', 
					title : '同杆架设组ID',
					sortable: true,
                    visible: false
				},
				{
					field : 'angle', 
					title : '角度',
					sortable: true,
                    visible: false
				},
				{
					field : 'poleHeight', 
					title : '杆高 数据字典 pole_height ',
					sortable: true,
                    visible: false
				},
				{
					field : 'crossType', 
					title : '被跨越物类型 数据字典 cross_type',
					sortable: true,
                    visible: false
				},
				{
					field : 'addDate', 
					title : '创建日期',
					sortable: true,
                    visible: false
				},
				{
					field : 'addUser', 
					title : '创建人',
					sortable: true,
                    visible: false
				},
				{
					field : 'updateUser', 
					title : '最近更新人',
					sortable: true,
                    visible: false
				},
				{
					field : 'updateDate', 
					title : '最近更新日期',
					sortable: true,
                    visible: false
				},
				{
					field : 'datastate', 
					title : '数据状态',
					sortable: true,
                    visible: false
				},
				{
					field : 'taskId', 
					title : '任务ID',
					sortable: true,
                    visible: false
				},
		        {
		            title: '操作',
		            align: 'center',
                    visible: false,
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);


            //单选框选择传值
            $("#bootstrap-table").on("check.bs.table", function (e, row, ele) {
//                console.log("id和name=="+row.id+">>"+row.name)
//				console.log(JSON.stringify(row))
                $("#id").val(row.id);
                $("#task_id").val(row.taskId);
            })
        });
    </script>
</body>
</html>